package com.homson.coreservice.servicecommon.enumeration;

/**
 * @author: homson_leo
 * @contact: hey_超级巨星（Homson_Leo）- 刘泓岑 1196816884@qq.com
 * @time: 2025/10/19 3:05 PM
 * 记账类型枚举绑定领域事件
 **/
public enum TransTypeEnum {
    
    INCOME(1001, "入账"),
    DEBIT(1002, "扣账"),
    TRANSFER(1003, "转账");
    private Integer code;
    private String cName;
    
    TransTypeEnum(Integer code, String desc) {
        this.code = code;
        this.cName = desc;
    }
    
    public Integer getCode() {
        return code;
    }
    
    public static TransTypeEnum of(Integer code) {
        for(TransTypeEnum transType: TransTypeEnum.values()){
            if(transType.getCode().equals(code)){
                return transType;
            }
        }
        return null;
    }
}
